﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FilesClassWork
{
    class Program
    {
        static void Main(string[] args)
        {
            string file = File.ReadAllText(@"C:\Users\anton\Documents\C#\Inteducation\aisaiev\FilesClassWork\FilesClassWork\HT.txt");
            string str = file.Replace("\r\n\r\n", " ").Replace(".", "").Replace(",", "").Replace("(", "").Replace(")", "");

            string[] fileSplit = str.Split(' ');
            Console.WriteLine("Amount of words in text: {0}", fileSplit.Length);

            int max = 0;
            int wordLength = 0;
            int wordIndex = 0;
            for (int i = 0; i < fileSplit.Length; i++)
            {
                wordLength = fileSplit[i].Length;
                if (wordLength > max)
                {
                    max = wordLength;
                    wordIndex = i;
                }
            }
            Console.WriteLine("Maximum word: {0}", fileSplit[wordIndex]);
        }
    }
}
